package gdma.hqdes.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import gdma.hqdes.bean.UnitScore;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UnitScoreMapper extends BaseMapper<UnitScore> {

    @Select("select s.* from unit_score s where s.project_id=#{projectId}")
    List<UnitScore> selectScores(long projectId);

    @Select("select s.* from unit_score s where s.project_id=#{projectId} and s.unit_id=#{unitId}")
    List<UnitScore> selectUnitScores(long projectId, long unitId);

    List<UnitScore> selectScoresWhole(long projectId, long unitId);

    @Select("select s.* from unit_score s where s.unit_id=#{unitId}")
    List<UnitScore> selectOwnedScores(long unitId);

}
